import * as React from 'react';
import { View } from 'remax/wechat';
import styles from './index.less';
import { getSystemInfoSync } from 'remax/wechat'

const index = (props) => {
  const [top, setTop] = React.useState(0);
  const { title } = props;
  React.useEffect(() => {
    const sysinfo = getSystemInfoSync();
    if (sysinfo && sysinfo.statusBarHeight) setTop(sysinfo.statusBarHeight);
  }, [])

  return <View className={`flex flex_col_center ${styles.navbar}`} style={{ top: `${top}PX` }}>
    {title}
  </View>
}

export default index;

